import Http from "@/util/http";

export const saveGameInfo = (data) => {
    return Http({
        url: '/just/game-info/save',
        method: 'post',
        data
    })
}

export const getGameList = (params) => {
    return Http({
        url: '/just/game-info/list',
        method: 'get',
        params
    })
}

export const getSimpleGameInfoList = (params) => {
    return Http({
        url: '/just/game-info/simple-list',
        method: 'get',
        params
    })
}


export const getSearchGameList = (params) => {
    return Http({
        url: '/just/game-info/search',
        method: 'get',
        params
    })
}

export const getGameEditDetail = (id) => {
    return Http({
        url: '/just/game-info/secret-detail',
        method: 'get',
        params: {
            id
        }
    })
}

export const getGameDetail = (id) => {
    return Http({
        url: '/just/game-info/detail',
        method: 'get',
        params: {
            id
        }
    })
}

export const adminUpdateGameInfo = (data) => {
    return Http({
        url: '/just/game-info/admin-update',
        method: 'post',
        data
    })
}

export const adminDeleteGameInfo = (data) => {
    return Http({
        url: '/just/game-info/admin-delete',
        method: 'delete',
        data
    })
}


/**
 * 加载热门推荐
 */
export const getPopularGames = (params) => {
    return Http({
        url: '/just/game-info/popular-games',
        method: 'get',
        params
    })
}
/**
 * 加载最新上架
 */
export const getNewReleasesGames = (params) => {
    return Http({
        url: '/just/game-info/releases-games',
        method: 'get',
        params
    })
}
/**
 * 加载口碑最佳
 */
export const getBestEvaluationGames = (params) => {
    return Http({
        url: '/just/game-info/best-evaluation-games',
        method: 'get',
        params
    })
}



